package uk.ac.nott.cs.g53dia;
/**
 * Action which replenishes the energy of the bee.
 *
 * @author Neil Madden
 */

/*
 * Copyright (c) 2005 Neil Madden (nem@cs.nott.ac.uk)
 * 
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

public class RestAction implements Action {

    public RestAction() {}

    public void execute(Environment env, Bee bee)
        throws ActionFailedException
    {
        if (bee.energy >= Bee.MAX_ENERGY) {
            // Not critical, but useful for debugging
            throw new ActionFailedException("Rest: bee has max energy");
        }
        bee.energy += 1;
    }

    public String toString() {
        return "Rest";
    }
}
